{layout name="layout" /}

<!-- Content -->
<section id="content" class="container">
	<!-- Breadcrumb -->
	{include file="public/breadcrumb"/}
	<h4 class="page-title b-0">单页面列表</h4>

	<div class="listview list-container">
		<header class="listview-header media">

			<ul class="list-inline list-mass-actions pull-left">
				<li>
					<a data-toggle="modal" href="{:url('page/add')}" title="Add" class="tooltips">
						<i class="sa-list-add"></i>
					</a>
				</li>

			</ul>

			<div class="clearfix"></div>
		</header>
		<div class="row">
			<div class="col-md-12">
				<div class="panel panel-default">
					<div class="panel-heading">单页面编辑</div>
					<div class="panel-body">
						<div class="row">
							<div class="col-sm-11">
								<form action="{:url('back/page/edit', ['id'=>$pageRow->id])}" class="form-horizontal ajax-form" method="post" name="rule">
									<div class="form-group">
										<label for="" class="col-sm-1 control-label">父级</label>
										<div class="col-sm-11">
											<select name="parent_id" class="form-control">
												<option value="0">===顶级===</option>
												{volist name="$pageRows" id="page"} {if condition="$page['id'] eq $pageRow->parent_id"}
												<option value="{$page.id}" selected="selected">{$page.title}</option>
												{else /}
												<option value="{$page.id}">{$page.title}</option>
												{/if} {volist name="$page->parent" id="pages"} {if condition="$pages['id'] eq $pageRow->parent_id"}
												<option value="{$pages.id}" selected="selected">&nbsp;&nbsp;┗━{$pages.title}</option>
												{else /}
												<option value="{$pages.id}">&nbsp;&nbsp;┗━{$pages.title}</option>
												{/if} {/volist} {/volist}
											</select>
										</div>
									</div>
									<div class="form-group">
										<label for="inputname" class="col-sm-1 control-label">标题</label>
										<div class="col-sm-11">
											<input type="text" class="form-control" value="{$pageRow->title}" name="title" id="inputname" placeholder="标题">
										</div>
									</div>

									<div class="form-group">
										<label for="inputkeyword" class="col-sm-1 control-label">关键词</label>
										<div class="col-sm-11">
											<input type="text" class="form-control" value="{$pageRow->keyword}" name="keyword" id="inputkeyword" placeholder="关键词">
										</div>
									</div>

									<div class="form-group">
										<label for="inputkeyword" class="col-sm-1 control-label">简介</label>
										<div class="col-sm-11">
											<textarea name="description" class="form-control">{$pageRow->description}</textarea>
										</div>
									</div>

									<div class="form-group">
										<label class="col-sm-1 control-label" for="inputSort"> 排序 </label>
										<div class="col-sm-11">
											<input type="text" class="form-control " value="{$pageRow->getData('sort')}" name="sort" id="inputSort" placeholder="越小越靠前">
										</div>
									</div>

									<div class="form-group">
										<label class="col-sm-1 control-label" for="inputSort"> 内容 </label>
										<div class="col-sm-11">
											<script type="text/javascript" charset="utf-8" src="{$Think.config.Ueditor}ueditor.config.js"></script>
											<script type="text/javascript" charset="utf-8" src="{$Think.config.Ueditor}ueditor.all.min.js">
											</script>
											<script type="text/javascript">
												var ue = UE.getEditor('editor', {
													autoHeightEnabled: true,

													autoFloatEnabled: true,

													initialFrameHeight: 500
												});
											</script>
											<textarea id="editor" name="content">{$pageRow->content}</textarea>

										</div>
									</div>

									<div class="form-group">
										<div class="col-sm-offset-1 col-sm-11">
											<button type="submit" class="btn btn-primary">更新</button>
										</div>
									</div>

								</form>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>

	</div>

</section>